#pragma once
#include <string>
#include <vector>
#include <map>

using namespace std;

class CTokenStream
{
public:
	enum TOKENS
	{
		COMMAND_RIGHT,
		COMMAND_QUACK,
		COMMAND_FLY,
		REPETITION_WHILE,
		WHITE_SPACE,
		SEMICOLON,
		LEFT_PARANTHESIS,
		RIGHT_PARANTHESIS,
		VARIABLE
	};
	enum ERRORS
	{
		UNEXPECTED_SYMBOL,
		NO_SEMICOLON
	};

	CTokenStream(string input);
	~CTokenStream(void);
	const vector<int> & tokenaze();

private:
	bool inArray(const vector<char> &arr, const char &needle);
	bool checkVariable(const string & variable);

	int checkId(const string & id); //finds variable id in m_ids - array of variables ids
	void pushSeparator(char c);
	void pushString(const string &str);
	void echoErrors();

	string m_inputStream;
	vector<int> m_outputStream;
	vector<string> m_ids;
	vector<CTokenStream::ERRORS> m_errors;
};
